home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / Controls.a < prev    next >
Encoding:
Text File  |  1998-02-12  |  81.3 KB  |  2,107 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Controls.a
  3. ;
  4. ;    Contains:    Control Manager interfaces
  5. ;
  6. ;    Version:    Technology:    Mac OS 8.1
  7. ;                Release:    Universal Interfaces 3.1
  8. ;
  9. ;    Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__CONTROLS__') = 'UNDEFINED' THEN
  19. __CONTROLS__ SET 1
  20.  
  21.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  22.     include 'MacTypes.a'
  23.     ENDIF
  24.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  25.     include 'Quickdraw.a'
  26.     ENDIF
  27.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  28.     include 'Menus.a'
  29.     ENDIF
  30.     IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
  31.     include 'TextEdit.a'
  32.     ENDIF
  33.     IF &TYPE('__DRAG__') = 'UNDEFINED' THEN
  34.     include 'Drag.a'
  35.     ENDIF
  36.     IF &TYPE('__ICONS__') = 'UNDEFINED' THEN
  37.     include 'Icons.a'
  38.     ENDIF
  39.  
  40.  
  41. _ControlDispatch                EQU        $AA73
  42.  
  43. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  44. ;     • Resource Types                                                                                    
  45. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  46.  
  47. kControlDefProcType                EQU        'CDEF'
  48. kControlTemplateResourceType    EQU        'CNTL'
  49. kControlColorTableResourceType    EQU        'cctb'
  50. kControlDefProcResourceType        EQU        'CDEF'
  51. kControlTabListResType            EQU        'tab#'                ; used for tab control (Appearance 1.0 and later)
  52. kControlListDescResType            EQU        'ldes'                ; used for list box control (Appearance 1.0 and later)
  53. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  54. ;     • Format of a ‘CNTL’ resource                                                                        
  55. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  56. ControlTemplate            RECORD 0
  57. controlRect                 ds        Rect            ; offset: $0 (0)
  58. controlValue             ds.w    1                ; offset: $8 (8)
  59. controlVisible             ds.b    1                ; offset: $A (10)
  60. fill                     ds.b    1                ; offset: $B (11)
  61. controlMaximum             ds.w    1                ; offset: $C (12)
  62. controlMinimum             ds.w    1                ; offset: $E (14)
  63. controlDefProcID         ds.w    1                ; offset: $10 (16)
  64. controlReference         ds.l    1                ; offset: $12 (18)
  65. controlTitle             ds        Str255            ; offset: $16 (22)
  66. sizeof                     EQU *                    ; size:   $116 (278)
  67.                         ENDR
  68. ; typedef struct ControlTemplate *        ControlTemplatePtr
  69.  
  70. ; typedef ControlTemplatePtr *            ControlTemplateHandle
  71.  
  72.  
  73.  
  74.     IF ¬ TARGET_OS_MAC THEN
  75.  
  76. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  77. ;   • NON-MAC COMPATIBILITY CODES (QuickTime 3.0)
  78. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  79.  
  80.  
  81. ; typedef UInt32                         ControlNotification
  82.  
  83.  
  84. controlNotifyNothing            EQU        'nada'                ; No (null) notification
  85. controlNotifyClick                EQU        'clik'                ; Control was clicked
  86. controlNotifyFocus                EQU        'focu'                ; Control got keyboard focus
  87. controlNotifyKey                EQU        'key '                ; Control got a keypress
  88. ; typedef UInt32                         ControlCapabilities
  89.  
  90.  
  91. kControlCanAutoInvalidate        EQU        $00000001            ; Control component automatically invalidates areas left behind after hide/move operation.
  92. ;  procID's for our added "controls"
  93.  
  94. staticTextProc                    EQU        256                    ; static text
  95. editTextProc                    EQU        272                    ; editable text
  96. iconProc                        EQU        288                    ; icon
  97. userItemProc                    EQU        304                    ; user drawn item
  98. pictItemProc                    EQU        320                    ; pict
  99.     ENDIF
  100. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  101. ;     • ControlHandle                                                                                        
  102. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  103.  
  104.  
  105. ; typedef ControlRecord *                ControlPtr
  106.  
  107. ; typedef ControlPtr *                    ControlHandle
  108.  
  109. ;  ControlRef is obsolete. Use ControlHandle. 
  110. ; typedef ControlHandle                 ControlRef
  111.  
  112. ; typedef SInt16                         ControlPartCode
  113.  
  114. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  115. ;  • Control ActionProcPtr                                                                                
  116. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  117. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  118. ;     • ControlRecord                                                                                        
  119. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  120. ControlRecord            RECORD 0
  121. nextControl                 ds.l    1                ; offset: $0 (0)
  122. contrlOwner                 ds.l    1                ; offset: $4 (4)
  123. contrlRect                 ds        Rect            ; offset: $8 (8)
  124. contrlVis                 ds.b    1                ; offset: $10 (16)
  125. contrlHilite             ds.b    1                ; offset: $11 (17)
  126. contrlValue                 ds.w    1                ; offset: $12 (18)
  127. contrlMin                 ds.w    1                ; offset: $14 (20)
  128. contrlMax                 ds.w    1                ; offset: $16 (22)
  129. contrlDefProc             ds.l    1                ; offset: $18 (24)
  130. contrlData                 ds.l    1                ; offset: $1C (28)
  131. contrlAction             ds.l    1                ; offset: $20 (32)
  132. contrlRfCon                 ds.l    1                ; offset: $24 (36)
  133. contrlTitle                 ds        Str255            ; offset: $28 (40)
  134. sizeof                     EQU *                    ; size:   $128 (296)
  135.                         ENDR
  136. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  137. ;  • Control ActionProcPtr : Epilogue                                                                    
  138. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  139. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  140. ;     • Control Color Table                                                                                
  141. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  142.  
  143. cFrameColor                        EQU        0
  144. cBodyColor                        EQU        1
  145. cTextColor                        EQU        2
  146. cThumbColor                        EQU        3
  147. kNumberCtlCTabEntries            EQU        4
  148. CtlCTab                    RECORD 0
  149. ccSeed                     ds.l    1                ; offset: $0 (0)
  150. ccRider                     ds.w    1                ; offset: $4 (4)
  151. ctSize                     ds.w    1                ; offset: $6 (6)
  152. ctTable                     ds.b    4 * ColorSpec.sizeof ; offset: $8 (8)
  153. sizeof                     EQU *                    ; size:   $28 (40)
  154.                         ENDR
  155. ; typedef struct CtlCTab *                CCTabPtr
  156.  
  157. ; typedef CCTabPtr *                    CCTabHandle
  158.  
  159. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  160. ;     • Auxiliary Control Record                                                                            
  161. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  162. AuxCtlRec                RECORD 0
  163. acNext                     ds.l    1                ; offset: $0 (0)
  164. acOwner                     ds.l    1                ; offset: $4 (4)
  165. acCTable                 ds.l    1                ; offset: $8 (8)
  166. acFlags                     ds.w    1                ; offset: $C (12)
  167. acReserved                 ds.l    1                ; offset: $E (14)
  168. acRefCon                 ds.l    1                ; offset: $12 (18)
  169. sizeof                     EQU *                    ; size:   $16 (22)
  170.                         ENDR
  171. ; typedef struct AuxCtlRec *            AuxCtlPtr
  172.  
  173. ; typedef AuxCtlPtr *                    AuxCtlHandle
  174.  
  175. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  176. ;     • PopUp Menu Private Data Structure                                                                    
  177. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  178. PopupPrivateData        RECORD 0
  179. mHandle                     ds.l    1                ; offset: $0 (0)
  180. mID                         ds.w    1                ; offset: $4 (4)
  181. sizeof                     EQU *                    ; size:   $6 (6)
  182.                         ENDR
  183. ; typedef struct PopupPrivateData *        PopupPrivateDataPtr
  184.  
  185. ; typedef PopupPrivateDataPtr *            PopupPrivateDataHandle
  186.  
  187.  
  188. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  189. ;     • Errors are in the range -30580 .. -30599                                                            
  190. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  191.  
  192. errMessageNotSupported            EQU        -30580
  193. errDataNotSupported                EQU        -30581
  194. errControlDoesntSupportFocus    EQU        -30582
  195. errWindowDoesntSupportFocus        EQU        -30583
  196. errUnknownControl                EQU        -30584
  197. errCouldntSetFocus                EQU        -30585
  198. errNoRootControl                EQU        -30586
  199. errRootAlreadyExists            EQU        -30587
  200. errInvalidPartCode                EQU        -30588
  201. errControlsAlreadyExist            EQU        -30589
  202. errControlIsNotEmbedder            EQU        -30590
  203. errDataSizeMismatch                EQU        -30591
  204. errControlHiddenOrDisabled        EQU        -30592
  205. errWindowRegionCodeInvalid        EQU        -30593
  206. errCantEmbedIntoSelf            EQU        -30594
  207. errCantEmbedRoot                EQU        -30595
  208. errItemNotControl                EQU        -30596
  209. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  210. ;     • Control Definition ID’s                                                                            
  211. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  212. ;  Standard System 7 procIDs
  213.  
  214.  
  215. pushButProc                        EQU        0
  216. checkBoxProc                    EQU        1
  217. radioButProc                    EQU        2
  218. scrollBarProc                    EQU        16
  219. popupMenuProc                    EQU        1008
  220.  
  221. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  222. ;     • Control Types and ID’s available only with Appearance 1.0 and later                                
  223. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  224.  
  225.  
  226. kControlSupportsNewMessages        EQU        ' ok '                ; CDEF should return as result of kControlMsgTestNewMsgSupport
  227. ;  focusing part codes 
  228.  
  229. kControlFocusNoPart                EQU        0                    ; tells control to clear its focus
  230. kControlFocusNextPart            EQU        -1                    ; tells control to focus on the next part
  231. kControlFocusPrevPart            EQU        -2                    ; tells control to focus on the previous part
  232. ; typedef SInt16                         ControlFocusPart
  233.  
  234. ;  Key Filter result codes                                                             
  235. ;                                                                                     
  236. ;  Certain controls can have a keyfilter attached to them. The filter proc should    
  237. ;  return one of the two constants below. If kKeyFilterBlockKey is returned, the    
  238. ;  key is blocked and never makes it to the control. If kKeyFilterPassKey is        
  239. ;  returned, the control receives the keystroke.                                    
  240.  
  241. kControlKeyFilterBlockKey        EQU        0
  242. kControlKeyFilterPassKey        EQU        1
  243. ; typedef SInt16                         ControlKeyFilterResult
  244.  
  245. ; ——————————————————————————————————————————————————————————————————————————————————————
  246. ;      SPECIAL FONT USAGE NOTES: You can specify the font to use for many control types.
  247. ;    The constants below are meta-font numbers which you can use to set a particular
  248. ;    control's font usage. There are essentially two modes you can use: 1) default,
  249. ;    which is essentially the same as it always has been, i.e. it uses the system font, unless
  250. ;    directed to use the window font via a control variant. 2) you can specify to use
  251. ;    the big or small system font in a generic manner. The Big system font is the font
  252. ;    used in menus, etc. Chicago has filled that role for some time now. Small system
  253. ;    font is currently Geneva 10. The meta-font number implies the size and style.
  254. ;    
  255. ;    NOTE:        Not all font attributes are used by all controls. Most, in fact, ignore
  256. ;                the fore and back color (Static Text is the only one that does, for
  257. ;                backwards compatibility). Also size, face, and addFontSize are ignored
  258. ;                when using the meta-font numbering.
  259. ;
  260.  
  261. ; ——————————————————————————————————————————————————————————————————————————————————————
  262.  
  263.                                                             ; Meta-font numbering - see not above 
  264. kControlFontBigSystemFont        EQU        -1                    ; force to big system font
  265. kControlFontSmallSystemFont        EQU        -2                    ; force to small system font
  266. kControlFontSmallBoldSystemFont    EQU        -3                    ; force to small bold system font
  267. ;  Add these masks together to set the flags field of a ControlFontStyleRec    
  268. ;  They specify which fields to apply to the text. It is important to make    
  269. ;  sure that you specify only the fields that you wish to set.                
  270.  
  271. kControlUseFontMask                EQU        $0001
  272. kControlUseFaceMask                EQU        $0002
  273. kControlUseSizeMask                EQU        $0004
  274. kControlUseForeColorMask        EQU        $0008
  275. kControlUseBackColorMask        EQU        $0010
  276. kControlUseModeMask                EQU        $0020
  277. kControlUseJustMask                EQU        $0040
  278. kControlUseAllMask                EQU        $00FF
  279. kControlAddFontSizeMask            EQU        $0100
  280. ControlFontStyleRec        RECORD 0
  281. flags                     ds.w    1                ; offset: $0 (0)
  282. font                     ds.w    1                ; offset: $2 (2)
  283. size                     ds.w    1                ; offset: $4 (4)
  284. style                     ds.w    1                ; offset: $6 (6)
  285. mode                     ds.w    1                ; offset: $8 (8)
  286. just                     ds.w    1                ; offset: $A (10)
  287. foreColor                 ds        RGBColor        ; offset: $C (12)
  288. backColor                 ds        RGBColor        ; offset: $12 (18)
  289. sizeof                     EQU *                    ; size:   $18 (24)
  290.                         ENDR
  291. ; typedef struct ControlFontStyleRec *    ControlFontStylePtr
  292.  
  293. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  294. ;     • Common data tags for Get/SetControlData                                                            
  295. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  296.  
  297. kControlFontStyleTag            EQU        'font'
  298. kControlKeyFilterTag            EQU        'fltr'
  299.  
  300. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  301. ;     • Control Feature Bits                                                                                
  302. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  303.  
  304.                                                             ; Control feature bits - returned by GetControlFeatures 
  305. kControlSupportsGhosting        EQU        $01
  306. kControlSupportsEmbedding        EQU        $02
  307. kControlSupportsFocus            EQU        $04
  308. kControlWantsIdle                EQU        $08
  309. kControlWantsActivate            EQU        $10
  310. kControlHandlesTracking            EQU        $20
  311. kControlSupportsDataAccess        EQU        $40
  312. kControlHasSpecialBackground    EQU        $80
  313. kControlGetsFocusOnClick        EQU        $0100
  314. kControlSupportsCalcBestRect    EQU        $0200
  315. kControlSupportsLiveFeedback    EQU        $0400
  316. ;  Features introduced in Appearance 1.0.1 
  317.  
  318. kControlHasRadioBehavior        EQU        $0800
  319. ;  Control Messages 
  320.  
  321. kControlMsgDrawGhost            EQU        13
  322. kControlMsgCalcBestRect            EQU        14                    ; Calculate best fitting rectangle for control
  323. kControlMsgHandleTracking        EQU        15
  324. kControlMsgFocus                EQU        16                    ; param indicates action.
  325. kControlMsgKeyDown                EQU        17
  326. kControlMsgIdle                    EQU        18
  327. kControlMsgGetFeatures            EQU        19
  328. kControlMsgSetData                EQU        20
  329. kControlMsgGetData                EQU        21
  330. kControlMsgActivate                EQU        22
  331. kControlMsgSetUpBackground        EQU        23
  332. kControlMsgCalcValueFromPos        EQU        26
  333. kControlMsgTestNewMsgSupport    EQU        27                    ; See if this control supports new messaging
  334. ;  Messages in Appearance 1.0.1 or later
  335.  
  336. kControlMsgSubValueChanged        EQU        25
  337. kControlMsgSubControlAdded        EQU        28
  338. kControlMsgSubControlRemoved    EQU        29
  339. ; ——————————————————————————————————————————————————————————————————————————————————————
  340. ;      This structure is passed into a CDEF when called with the kControlMsgHandleTracking    
  341. ;     message                                                                             
  342. ; ——————————————————————————————————————————————————————————————————————————————————————
  343. ControlTrackingRec        RECORD 0
  344. startPt                     ds        Point            ; offset: $0 (0)
  345. modifiers                 ds.w    1                ; offset: $4 (4)
  346. action                     ds.l    1                ; offset: $6 (6)
  347. sizeof                     EQU *                    ; size:   $A (10)
  348.                         ENDR
  349. ; typedef struct ControlTrackingRec *    ControlTrackingPtr
  350.  
  351. ; ——————————————————————————————————————————————————————————————————————————————————————
  352. ;  This structure is passed into a CDEF when called with the kControlMsgKeyDown message 
  353. ; ——————————————————————————————————————————————————————————————————————————————————————
  354. ControlKeyDownRec        RECORD 0
  355. modifiers                 ds.w    1                ; offset: $0 (0)
  356. keyCode                     ds.w    1                ; offset: $2 (2)
  357. charCode                 ds.w    1                ; offset: $4 (4)
  358. sizeof                     EQU *                    ; size:   $6 (6)
  359.                         ENDR
  360. ; typedef struct ControlKeyDownRec *    ControlKeyDownPtr
  361.  
  362. ; ——————————————————————————————————————————————————————————————————————————————————————
  363. ;  This structure is passed into a CDEF when called with the kControlMsgGetData or        
  364. ;  kControlMsgSetData message                                                             
  365. ; ——————————————————————————————————————————————————————————————————————————————————————
  366. ControlDataAccessRec    RECORD 0
  367. tag                         ds.l    1                ; offset: $0 (0)
  368. part                     ds.l    1                ; offset: $4 (4)
  369. size                     ds.l    1                ; offset: $8 (8)
  370. dataPtr                     ds.l    1                ; offset: $C (12)
  371. sizeof                     EQU *                    ; size:   $10 (16)
  372.                         ENDR
  373. ; typedef struct ControlDataAccessRec *    ControlDataAccessPtr
  374.  
  375. ; ——————————————————————————————————————————————————————————————————————————————————————
  376. ;  This structure is passed into a CDEF when called with the kControlCalcBestRect msg     
  377. ; ——————————————————————————————————————————————————————————————————————————————————————
  378. ControlCalcSizeRec        RECORD 0
  379. height                     ds.w    1                ; offset: $0 (0)
  380. width                     ds.w    1                ; offset: $2 (2)
  381. baseLine                 ds.w    1                ; offset: $4 (4)
  382. sizeof                     EQU *                    ; size:   $6 (6)
  383.                         ENDR
  384. ; typedef struct ControlCalcSizeRec *    ControlCalcSizePtr
  385.  
  386. ; ——————————————————————————————————————————————————————————————————————————————————————
  387. ;  This structure is passed into a CDEF when called with the kControlMsgSetUpBackground 
  388. ;  message is sent                                                                        
  389. ; ——————————————————————————————————————————————————————————————————————————————————————
  390. ControlBackgroundRec    RECORD 0
  391. depth                     ds.w    1                ; offset: $0 (0)
  392. colorDevice                 ds.b    1                ; offset: $2 (2)
  393.                          ORG 4
  394. sizeof                     EQU *                    ; size:   $4 (4)
  395.                         ENDR
  396. ; typedef struct ControlBackgroundRec *    ControlBackgroundPtr
  397.  
  398. ; ——————————————————————————————————————————————————————————————————————————————————————
  399. ;  This structure is passed into a CDEF when called with the kControlMsgApplyTextColor    
  400. ;  message is sent                                                                        
  401. ; ——————————————————————————————————————————————————————————————————————————————————————
  402. ControlApplyTextColorRec RECORD 0
  403. depth                     ds.w    1                ; offset: $0 (0)
  404. colorDevice                 ds.b    1                ; offset: $2 (2)
  405. active                     ds.b    1                ; offset: $3 (3)
  406. sizeof                     EQU *                    ; size:   $4 (4)
  407.                         ENDR
  408. ; typedef struct ControlApplyTextColorRec * ControlApplyTextColorPtr
  409.  
  410. ; ——————————————————————————————————————————————————————————————————————————————————————
  411. ;     Key Filter                                                                            
  412. ;                                                                                         
  413. ;  Definition of a key filter for intercepting and possibly changing keystrokes            
  414. ;  which are destined for a control                                                        
  415. ; ——————————————————————————————————————————————————————————————————————————————————————
  416. ; ——————————————————————————————————————————————————————————————————————————————————————
  417. ;     • BEVEL BUTTON INTERFACE (CDEF 2)                                                    
  418. ; ——————————————————————————————————————————————————————————————————————————————————————
  419. ;     Bevel buttons allow you to control the content type (pict/icon/etc.), the behavior    
  420. ;  (pushbutton/toggle/sticky), and the bevel size. You also have the option of            
  421. ;     attaching a menu to it. When a menu is present, you can specify which way the         
  422. ;     popup arrow is facing (down or right).                                                
  423. ;                                                                                         
  424. ;     This is all made possible by overloading the Min, Max, and Value parameters for the    
  425. ;     control, as well as adjusting the variant. Here's the breakdown of what goes where:    
  426. ;                                                                                         
  427. ;     Parameter                    What Goes Here                                            
  428. ;     ———————————————————            ————————————————————————————————————————————————————    
  429. ;     Min                            Hi Byte = Behavior, Lo Byte = content type.                
  430. ;     Max                            ResID for resource-based content types.                    
  431. ;     Value                        MenuID to attach, 0 = no menu, please.                    
  432. ;                                                                                         
  433. ;     The variant is broken down into two halfs. The low 2 bits control the bevel type.    
  434. ;     Bit 2 controls the popup arrow direction (if a menu is present) and bit 3 controls    
  435. ;     whether or not to use the control's owning window's font.                            
  436. ;                                                                                         
  437. ;     Constants for all you need to put this together are below. The values for behaviors    
  438. ;     are set up so that you can simply add them to the content type and pass them into    
  439. ;     the Min parameter of NewControl.                                                    
  440. ;                                                                                         
  441. ;     An example call:                                                                    
  442. ;                                                                                         
  443. ;     control = NewControl( window, &bounds, "\p", true, 0, kContentIconSuiteRes +         
  444. ;                             kBehaviorToggles, myIconSuiteID, bevelButtonSmallBevelProc,    
  445. ;                             0L );                                                        
  446. ;                                                                                         
  447. ;     Attaching a menu:                                                                    
  448. ;                                                                                         
  449. ;     control = NewControl( window, &bounds, "\p", true, kMyMenuID, kContentIconSuiteRes,    
  450. ;             myIconSuiteID, bevelButtonSmallBevelProc + kBevelButtonMenuOnRight, 0L );    
  451. ;                                                                                         
  452. ;     This will attach menu ID kMyMenuID to the button, with the popup arrow facing right.
  453. ;     This also puts the menu up to the right of the button. You can also specify that a    
  454. ;     menu can have multiple items checked at once by adding kBehaviorMultiValueMenus        
  455. ;     into the Min parameter. If you do use multivalue menus, the GetBevelButtonMenuValue    
  456. ;     helper function will return the last item chosen from the menu, whether or not it    
  457. ;     was checked.                                                                        
  458. ;                                                                                         
  459. ;     NOTE:     Bevel buttons with menus actually have *two* values. The value of the         
  460. ;             button (on/off), and the value of the menu. The menu value can be gotten    
  461. ;             with the GetBevelButtonMenuValue helper function.                            
  462. ;                                                                                         
  463. ;     Handle-based Content                                                                
  464. ;     ————————————————————                                                                
  465. ;     You can create your control and then set the content to an existing handle to an    
  466. ;     icon suite, etc. using the macros below. Please keep in mind that resource-based    
  467. ;     content is owned by the control, handle-based content is owned by you. The CDEF will
  468. ;     not try to dispose of handle-based content. If you are changing the content type of    
  469. ;     the button on the fly, you must make sure that if you are replacing a handle-        
  470. ;     based content with a resource-based content to properly dispose of the handle,        
  471. ;     else a memory leak will ensue.                                                        
  472. ;                                                                                         
  473.  
  474.                                                             ; Bevel Button Proc IDs 
  475. kControlBevelButtonSmallBevelProc EQU    32
  476. kControlBevelButtonNormalBevelProc EQU    33
  477. kControlBevelButtonLargeBevelProc EQU    34
  478.  
  479.                                                             ; Bevel button graphic alignment values 
  480. kControlBevelButtonAlignSysDirection EQU -1                    ; only left or right
  481. kControlBevelButtonAlignCenter    EQU        0
  482. kControlBevelButtonAlignLeft    EQU        1
  483. kControlBevelButtonAlignRight    EQU        2
  484. kControlBevelButtonAlignTop        EQU        3
  485. kControlBevelButtonAlignBottom    EQU        4
  486. kControlBevelButtonAlignTopLeft    EQU        5
  487. kControlBevelButtonAlignBottomLeft EQU    6
  488. kControlBevelButtonAlignTopRight EQU    7
  489. kControlBevelButtonAlignBottomRight EQU    8
  490. ; typedef SInt16                         ControlButtonGraphicAlignment
  491.  
  492.  
  493.                                                             ; Bevel button text alignment values 
  494. kControlBevelButtonAlignTextSysDirection EQU 0
  495. kControlBevelButtonAlignTextCenter EQU    1
  496. kControlBevelButtonAlignTextFlushRight EQU -1
  497. kControlBevelButtonAlignTextFlushLeft EQU -2
  498. ; typedef SInt16                         ControlButtonTextAlignment
  499.  
  500.  
  501.                                                             ; Bevel button text placement values 
  502. kControlBevelButtonPlaceSysDirection EQU -1                    ; if graphic on right, then on left
  503. kControlBevelButtonPlaceNormally EQU    0
  504. kControlBevelButtonPlaceToRightOfGraphic EQU 1
  505. kControlBevelButtonPlaceToLeftOfGraphic EQU 2
  506. kControlBevelButtonPlaceBelowGraphic EQU 3
  507. kControlBevelButtonPlaceAboveGraphic EQU 4
  508. ; typedef SInt16                         ControlButtonTextPlacement
  509.  
  510. ;  Add these variant codes to kBevelButtonSmallBevelProc to change the type of button 
  511.  
  512. kControlBevelButtonSmallBevelVariant EQU 0
  513. kControlBevelButtonNormalBevelVariant EQU $01
  514. kControlBevelButtonLargeBevelVariant EQU $02
  515. kControlBevelButtonMenuOnRight    EQU        $04
  516.  
  517. ;   Behaviors of bevel buttons. These are set up so you can add
  518. ;   them together with the content types.
  519.  
  520.  
  521.  
  522. kControlBehaviorPushbutton        EQU        0
  523. kControlBehaviorToggles            EQU        $0100
  524. kControlBehaviorSticky            EQU        $0200
  525. kControlBehaviorMultiValueMenu    EQU        $4000                ; only makes sense when a menu is attached.
  526. kControlBehaviorOffsetContents    EQU        $8000
  527. ;  Behaviors for 1.0.1 or later 
  528.  
  529. kControlBehaviorCommandMenu        EQU        $2000                ; menu holds commands, not choices. Overrides multi-value bit.
  530. ;  Content types supported by bevel buttons *and* image wells
  531.  
  532. kControlContentTextOnly            EQU        0
  533. kControlContentIconSuiteRes        EQU        1
  534. kControlContentCIconRes            EQU        2
  535. kControlContentPictRes            EQU        3
  536. kControlContentIconSuiteHandle    EQU        129
  537. kControlContentCIconHandle        EQU        130
  538. kControlContentPictHandle        EQU        131
  539. kControlContentIconRef            EQU        132
  540. ; typedef SInt16                         ControlContentType
  541.  
  542. ;  Data tags supported by the bevel button controls 
  543.  
  544. kControlBevelButtonContentTag    EQU        'cont'                ; ButtonContentInfo
  545. kControlBevelButtonTransformTag    EQU        'tran'                ; IconTransformType
  546. kControlBevelButtonTextAlignTag    EQU        'tali'                ; ButtonTextAlignment
  547. kControlBevelButtonTextOffsetTag EQU    'toff'                ; SInt16
  548. kControlBevelButtonGraphicAlignTag EQU    'gali'                ; ButtonGraphicAlignment
  549. kControlBevelButtonGraphicOffsetTag EQU    'goff'                ; Point
  550. kControlBevelButtonTextPlaceTag    EQU        'tplc'                ; ButtonTextPlacement
  551. kControlBevelButtonMenuValueTag    EQU        'mval'                ; SInt16
  552. kControlBevelButtonMenuHandleTag EQU    'mhnd'                ; MenuHandle
  553. kControlBevelButtonCenterPopupGlyphTag EQU 'pglc'            ; Boolean: true = center, false = bottom right
  554. ;  These are tags in 1.0.1 or later 
  555.  
  556. kControlBevelButtonLastMenuTag    EQU        'lmnu'                ; SInt16: menuID of last menu item selected from
  557. kControlBevelButtonMenuDelayTag    EQU        'mdly'                ; SInt32: ticks to delay before menu appears
  558. ;  Structure to pass into bevel buttons and image wells to set/get content type 
  559. ControlButtonContentInfo RECORD 0
  560. contentType                 ds.w    1                ; offset: $0 (0)
  561. resID                     ds.w    1                ; offset: $2 (2)
  562.                          ORG 2
  563. cIconHandle                 ds.l    1                ; offset: $2 (2)
  564.                          ORG 2
  565. iconSuite                 ds.l    1                ; offset: $2 (2)
  566.                          ORG 2
  567. iconRef                     ds.l    1                ; offset: $2 (2)
  568.                          ORG 2
  569. picture                     ds.l    1                ; offset: $2 (2)
  570. sizeof                     EQU *                    ; size:   $6 (6)
  571.                         ENDR
  572. ; typedef struct ControlButtonContentInfo * ControlButtonContentInfoPtr
  573.  
  574. ; ——————————————————————————————————————————————————————————————————————————————————————
  575. ;     • SLIDER (CDEF 3)                                                                    
  576. ; ——————————————————————————————————————————————————————————————————————————————————————
  577. ;     There are several variants that control the behavior of the slider control. Any        
  578. ;     combination of the following three constants can be added to the basic CDEF ID        
  579. ;     (kSliderProc).                                                                        
  580. ;                                                                                         
  581. ;     Variants:                                                                            
  582. ;                                                                                         
  583. ;         kSliderLiveFeedback         Slider does not use "ghosted" indicator when tracking.    
  584. ;                                 ActionProc is called (set via SetControlAction) as the    
  585. ;                                 indicator is dragged. The value is updated so that the    
  586. ;                                 actionproc can adjust some other property based on the    
  587. ;                                 value each time the action proc is called. If no action    
  588. ;                                 proc is installed, it reverts to the ghost indicator.    
  589. ;                                                                                         
  590. ;         kSliderHasTickMarks         Slider is drawn with 'tick marks'. The control            
  591. ;                                 rectangle must be large enough to accomidate the tick    
  592. ;                                 marks.                                                    
  593. ;                                                                                         
  594. ;         kSliderReverseDirection    Slider thumb points in opposite direction than normal.    
  595. ;                                 If the slider is vertical, the thumb will point to the    
  596. ;                                 left, if the slider is horizontal, the thumb will point    
  597. ;                                 upwards.                                                
  598. ;                                                                                         
  599. ;         kSliderNonDirectional    This option overrides the kSliderReverseDirection and    
  600. ;                                 kSliderHasTickMarks variants. It creates an indicator    
  601. ;                                 which is rectangular and doesn't point in any direction    
  602. ;                                 like the normal indicator does.                            
  603.  
  604.                                                             ; Slider proc IDs 
  605. kControlSliderProc                EQU        48
  606. kControlSliderLiveFeedback        EQU        $01
  607. kControlSliderHasTickMarks        EQU        $02
  608. kControlSliderReverseDirection    EQU        $04
  609. kControlSliderNonDirectional    EQU        $08
  610.  
  611. ; ——————————————————————————————————————————————————————————————————————————————————————
  612. ;     • DISCLOSURE TRIANGLE (CDEF 4)                                                        
  613. ; ——————————————————————————————————————————————————————————————————————————————————————
  614. ;     This control can be used as either left or right facing. It can also handle its own    
  615. ;     tracking if you wish. This means that when the 'autotoggle' variant is used, if the    
  616. ;     user clicks the control, it's state will change automatically from open to closed    
  617. ;     and vice-versa depending on its initial state. After a successful call to Track-    
  618. ;      Control, you can just check the current value to see what state it was switched to.    
  619.  
  620.                                                             ; Triangle proc IDs 
  621. kControlTriangleProc            EQU        64
  622. kControlTriangleLeftFacingProc    EQU        65
  623. kControlTriangleAutoToggleProc    EQU        66
  624. kControlTriangleLeftFacingAutoToggleProc EQU 67
  625.  
  626.                                                             ; Tagged data supported by disclosure triangles 
  627. kControlTriangleLastValueTag    EQU        'last'                ; SInt16
  628. ; ——————————————————————————————————————————————————————————————————————————————————————
  629. ;     • PROGRESS INDICATOR (CDEF 5)                                                        
  630. ; ——————————————————————————————————————————————————————————————————————————————————————
  631. ;     This CDEF implements both determinate and indeterminate progress bars. To switch,     
  632. ;     just use SetControlData to set the indeterminate flag to make it indeterminate call    
  633. ;     IdleControls to step thru the animation. IdleControls should be called at least        
  634. ;     once during your event loop.                                                        
  635. ;                                                                                         
  636.  
  637.                                                             ; Progress Bar proc IDs 
  638. kControlProgressBarProc            EQU        80
  639.  
  640.                                                             ; Tagged data supported by progress bars 
  641. kControlProgressBarIndeterminateTag EQU    'inde'                ; Boolean
  642. ; ——————————————————————————————————————————————————————————————————————————————————————
  643. ;     • LITTLE ARROWS (CDEF 6)                                                            
  644. ; ——————————————————————————————————————————————————————————————————————————————————————
  645. ;      This control implements the little up and down arrows you'd see in the Memory        
  646. ;     control panel for adjusting the cache size.                                         
  647.  
  648.                                                             ; Little Arrows proc IDs 
  649. kControlLittleArrowsProc        EQU        96
  650. ; ——————————————————————————————————————————————————————————————————————————————————————
  651. ;     • CHASING ARROWS (CDEF 7)                                                            
  652. ; ——————————————————————————————————————————————————————————————————————————————————————
  653. ;     To animate this control, make sure to call IdleControls repeatedly.                    
  654. ;                                                                                         
  655.  
  656.                                                             ; Chasing Arrows proc IDs 
  657. kControlChasingArrowsProc        EQU        112
  658. ; ——————————————————————————————————————————————————————————————————————————————————————
  659. ;     • TABS (CDEF 8)                                                                        
  660. ; ——————————————————————————————————————————————————————————————————————————————————————
  661. ;     Tabs use an auxiliary resource (tab#) to hold tab information such as the tab name    
  662. ;     and an icon suite ID for each tab.                                                    
  663. ;                                                                                         
  664. ;     The ID of the tab# resource that you wish to associate with a tab control should     
  665. ;     be passed in as the Value parameter of the control. If you are using GetNewControl, 
  666. ;     then the Value slot in the CNTL resource should have the ID of the 'tab#' resource    
  667. ;     on creation.                                                                        
  668. ;                                                                                         
  669. ;     Passing zero in for the tab# resource tells the control not to read in a tab# res.    
  670. ;     You can then use SetControlMaximum to add tabs, followed by a call to SetControlData
  671. ;     with the kControlTabInfoTag, passing in a pointer to a ControlTabInfoRec. This sets    
  672. ;      the name and optionally an icon for a tab.                                            
  673.  
  674.                                                             ; Tabs proc IDs 
  675. kControlTabLargeProc            EQU        128                    ; Large tab size, north facing    
  676. kControlTabSmallProc            EQU        129                    ; Small tab size, north facing    
  677. kControlTabLargeNorthProc        EQU        128                    ; Large tab size, north facing    
  678. kControlTabSmallNorthProc        EQU        129                    ; Small tab size, north facing    
  679. kControlTabLargeSouthProc        EQU        130                    ; Large tab size, south facing    
  680. kControlTabSmallSouthProc        EQU        131                    ; Small tab size, south facing    
  681. kControlTabLargeEastProc        EQU        132                    ; Large tab size, east facing    
  682. kControlTabSmallEastProc        EQU        133                    ; Small tab size, east facing    
  683. kControlTabLargeWestProc        EQU        134                    ; Large tab size, west facing    
  684. kControlTabSmallWestProc        EQU        135                    ; Small tab size, west facing    
  685.  
  686.                                                             ; Tagged data supported by progress bars 
  687. kControlTabContentRectTag        EQU        'rect'                ; Rect
  688. kControlTabEnabledFlagTag        EQU        'enab'                ; Boolean
  689. kControlTabFontStyleTag            EQU        'font'                ; ControlFontStyleRec
  690. ;  New tags in 1.0.1 or later 
  691.  
  692. kControlTabInfoTag                EQU        'tabi'                ; ControlTabInfoRec
  693.  
  694. kControlTabInfoVersionZero        EQU        0
  695. ControlTabInfoRec        RECORD 0
  696. version                     ds.w    1                ; offset: $0 (0)        ;  version of this structure.
  697. iconSuiteID                 ds.w    1                ; offset: $2 (2)        ;  icon suite to use. Zero indicates no icon
  698. name                     ds        Str255            ; offset: $4 (4)        ;  name to be displayed on the tab
  699. sizeof                     EQU *                    ; size:   $104 (260)
  700.                         ENDR
  701. ; ——————————————————————————————————————————————————————————————————————————————————————
  702. ;     • VISUAL SEPARATOR (CDEF 9)                                                            
  703. ; ——————————————————————————————————————————————————————————————————————————————————————
  704. ;     Separator lines determine their orientation (horizontal or vertical) automatically    
  705. ;     based on the relative height and width of their contrlRect.                            
  706.  
  707.                                                             ; Visual separator proc IDs 
  708. kControlSeparatorLineProc        EQU        144
  709.  
  710. ; ——————————————————————————————————————————————————————————————————————————————————————
  711. ;     • GROUP BOX (CDEF 10)                                                                
  712. ; ——————————————————————————————————————————————————————————————————————————————————————
  713. ;     The group box CDEF can be use in several ways. It can have no title, a text title,     
  714. ;     a check box as the title, or a popup button as a title. There are two versions of     
  715. ;     group boxes, primary and secondary, which look slightly different.                    
  716.  
  717.                                                             ; Group Box proc IDs 
  718. kControlGroupBoxTextTitleProc    EQU        160
  719. kControlGroupBoxCheckBoxProc    EQU        161
  720. kControlGroupBoxPopupButtonProc    EQU        162
  721. kControlGroupBoxSecondaryTextTitleProc EQU 164
  722. kControlGroupBoxSecondaryCheckBoxProc EQU 165
  723. kControlGroupBoxSecondaryPopupButtonProc EQU 166
  724.  
  725.                                                             ; Tagged data supported by group box 
  726. kControlGroupBoxMenuHandleTag    EQU        'mhan'                ; MenuHandle (popup title only)
  727. kControlGroupBoxFontStyleTag    EQU        'font'                ; ControlFontStyleRec
  728. ; ——————————————————————————————————————————————————————————————————————————————————————
  729. ;     • IMAGE WELL (CDEF 11)                                                                
  730. ; ——————————————————————————————————————————————————————————————————————————————————————
  731. ;     Image Wells allow you to control the content type (pict/icon/etc.) shown in the     
  732. ;     well.                                                                                
  733. ;                                                                                         
  734. ;     This is made possible by overloading the Min and Value parameters for the control.    
  735. ;                                                                                         
  736. ;     Parameter                    What Goes Here                                            
  737. ;     ———————————————————            ——————————————————————————————————————————————————        
  738. ;     Min                            content type (see constants for bevel buttons)            
  739. ;     Value                        Resource ID of content type, if resource-based.            
  740. ;                                                                                         
  741. ;                                                                                         
  742. ;     Handle-based Content                                                                
  743. ;     ————————————————————                                                                
  744. ;     You can create your control and then set the content to an existing handle to an    
  745. ;     icon suite, etc. using the macros below. Please keep in mind that resource-based    
  746. ;     content is owned by the control, handle-based content is owned by you. The CDEF will
  747. ;     not try to dispose of handle-based content. If you are changing the content type of    
  748. ;     the button on the fly, you must make sure that if you are replacing a handle-        
  749. ;     based content with a resource-based content to properly dispose of the handle,        
  750. ;     else a memory leak will ensue.                                                        
  751. ;                                                                                         
  752.  
  753.                                                             ; Image Well proc IDs 
  754. kControlImageWellProc            EQU        176
  755.  
  756.                                                             ; Tagged data supported by image wells 
  757. kControlImageWellContentTag        EQU        'cont'                ; ButtonContentInfo
  758. kControlImageWellTransformTag    EQU        'tran'                ; IconTransformType
  759. ; ——————————————————————————————————————————————————————————————————————————————————————
  760. ;     • POPUP ARROW (CDEF 12)                                                                
  761. ; ——————————————————————————————————————————————————————————————————————————————————————
  762. ;     The popup arrow CDEF is used to draw the small arrow normally associated with a     
  763. ;     popup control. The arrow can point in four directions, and a small or large version 
  764. ;     can be used. This control is provided to allow clients to draw the arrow in a         
  765. ;     normalized fashion which will take advantage of themes automatically.                
  766. ;                                                                                         
  767.  
  768.                                                             ; Popup Arrow proc IDs 
  769. kControlPopupArrowEastProc        EQU        192
  770. kControlPopupArrowWestProc        EQU        193
  771. kControlPopupArrowNorthProc        EQU        194
  772. kControlPopupArrowSouthProc        EQU        195
  773. kControlPopupArrowSmallEastProc    EQU        196
  774. kControlPopupArrowSmallWestProc    EQU        197
  775. kControlPopupArrowSmallNorthProc EQU    198
  776. kControlPopupArrowSmallSouthProc EQU    199
  777. ; ——————————————————————————————————————————————————————————————————————————————————————
  778. ;     • PLACARD (CDEF 14)                                                                    
  779. ; ——————————————————————————————————————————————————————————————————————————————————————
  780.  
  781.                                                             ; Placard proc IDs 
  782. kControlPlacardProc                EQU        224
  783. ; ——————————————————————————————————————————————————————————————————————————————————————
  784. ;     • CLOCK (CDEF 15)                                                                    
  785. ; ——————————————————————————————————————————————————————————————————————————————————————
  786. ;      NOTE:    You can specify more options in the Value paramter when creating the clock.    
  787. ;             See below.                                                                    
  788.  
  789.                                                             ; Clock proc IDs 
  790. kControlClockTimeProc            EQU        240
  791. kControlClockTimeSecondsProc    EQU        241
  792. kControlClockDateProc            EQU        242
  793. kControlClockMonthYearProc        EQU        243
  794. ; ——————————————————————————————————————————————————————————————————————————————————————
  795. ;      These flags can be passed into 'value' field on creation of the control.            
  796. ;      Value is set to 0 after control is created.                                            
  797. ;                                                                                         
  798. ;     The kClockIsLive value tells the clock to automatically update on idle (clock will    
  799. ;     have the current time). This flag is only valid when the kClockIsDisplayOnly flag    
  800. ;     is set.                                                                                
  801. ; ——————————————————————————————————————————————————————————————————————————————————————
  802.  
  803. kControlClockNoFlags            EQU        0
  804. kControlClockIsDisplayOnly        EQU        1
  805. kControlClockIsLive                EQU        2
  806.  
  807.                                                             ; Tagged data supported by clocks 
  808. kControlClockLongDateTag        EQU        'date'                ; LongDateRec
  809. kControlClockFontStyleTag        EQU        'font'                ; ControlFontStyleRec
  810. ; ——————————————————————————————————————————————————————————————————————————————————————
  811. ;     • USER PANE (CDEF 16)                                                                
  812. ; ——————————————————————————————————————————————————————————————————————————————————————
  813.  
  814.                                                             ; User Pane proc IDs 
  815. kControlUserPaneProc            EQU        256
  816. ;  Tagged data supported by user panes 
  817. ;  Currently, they are all proc ptrs for doing things like drawing and hit testing, etc. 
  818.  
  819. kControlUserItemDrawProcTag        EQU        'uidp'                ; UserItemUPP
  820. kControlUserPaneDrawProcTag        EQU        'draw'                ; ControlUserPaneDrawingUPP
  821. kControlUserPaneHitTestProcTag    EQU        'hitt'                ; ControlUserPaneHitTestUPP
  822. kControlUserPaneTrackingProcTag    EQU        'trak'                ; ControlUserPaneTrackingUPP
  823. kControlUserPaneIdleProcTag        EQU        'idle'                ; ControlUserPaneIdleUPP
  824. kControlUserPaneKeyDownProcTag    EQU        'keyd'                ; ControlUserPaneKeyDownUPP
  825. kControlUserPaneActivateProcTag    EQU        'acti'                ; ControlUserPaneActivateUPP
  826. kControlUserPaneFocusProcTag    EQU        'foci'                ; ControlUserPaneFocusUPP
  827. kControlUserPaneBackgroundProcTag EQU    'back'                ; ControlUserPaneBackgroundUPP
  828.  
  829. ;  ——————————————————————————————————————————————————————————————————————————————————————————
  830. ;      • EDIT TEXT (CDEF 17)
  831. ;  ——————————————————————————————————————————————————————————————————————————————————————————
  832.  
  833.  
  834.  
  835.                                                             ; Edit Text proc IDs 
  836. kControlEditTextProc            EQU        272
  837. kControlEditTextDialogProc        EQU        273
  838. kControlEditTextPasswordProc    EQU        274
  839. kControlEditTextDialogPasswordProc EQU    275
  840.  
  841.                                                             ; Tagged data supported by edit text 
  842. kControlEditTextStyleTag        EQU        'font'                ; ControlFontStyleRec
  843. kControlEditTextTextTag            EQU        'text'                ; Buffer of chars - you supply the buffer
  844. kControlEditTextTEHandleTag        EQU        'than'                ; The TEHandle of the text edit record
  845. kControlEditTextKeyFilterTag    EQU        'fltr'
  846. kControlEditTextSelectionTag    EQU        'sele'                ; EditTextSelectionRec
  847. kControlEditTextPasswordTag        EQU        'pass'                ; The clear text password text
  848. ControlEditTextSelectionRec RECORD 0
  849. ;  Structure for getting the edit text selection 
  850. selStart                 ds.w    1                ; offset: $0 (0)
  851. selEnd                     ds.w    1                ; offset: $2 (2)
  852. sizeof                     EQU *                    ; size:   $4 (4)
  853.                         ENDR
  854. ; typedef struct ControlEditTextSelectionRec * ControlEditTextSelectionPtr
  855.  
  856. ; ——————————————————————————————————————————————————————————————————————————————————————
  857. ;     • STATIC TEXT (CDEF 18)                                                                
  858. ; ——————————————————————————————————————————————————————————————————————————————————————
  859. ;  Static Text proc IDs 
  860.  
  861. kControlStaticTextProc            EQU        288
  862. ;  Tagged data supported by static text 
  863.  
  864. kControlStaticTextStyleTag        EQU        'font'                ; ControlFontStyleRec
  865. kControlStaticTextTextTag        EQU        'text'                ; Copy of text
  866. kControlStaticTextTextHeightTag    EQU        'thei'                ; SInt16
  867. ; ——————————————————————————————————————————————————————————————————————————————————————
  868. ;     • PICTURE CONTROL (CDEF 19)                                                            
  869. ; ——————————————————————————————————————————————————————————————————————————————————————
  870. ;     Value parameter should contain the ID of the picture you wish to display when        
  871. ;     creating controls of this type. If you don't want the control tracked at all, use     
  872. ;     the 'no track' variant.                                                                
  873.  
  874.                                                             ; Picture control proc IDs 
  875. kControlPictureProc                EQU        304
  876. kControlPictureNoTrackProc        EQU        305                    ; immediately returns kControlPicturePart
  877. ; ——————————————————————————————————————————————————————————————————————————————————————
  878. ;     • ICON CONTROL (CDEF 20)                                                            
  879. ; ——————————————————————————————————————————————————————————————————————————————————————
  880. ;     Value parameter should contain the ID of the ICON or cicn you wish to display when    
  881. ;     creating controls of this type. If you don't want the control tracked at all, use     
  882. ;     the 'no track' variant.                                                                
  883. ;  Icon control proc IDs 
  884.  
  885. kControlIconProc                EQU        320
  886. kControlIconNoTrackProc            EQU        321                    ; immediately returns kControlIconPart
  887. kControlIconSuiteProc            EQU        322
  888. kControlIconSuiteNoTrackProc    EQU        323                    ; immediately returns kControlIconPart
  889. ;  Tagged data supported by icon controls 
  890.  
  891. kControlIconTransformTag        EQU        'trfm'                ; IconTransformType
  892. kControlIconAlignmentTag        EQU        'algn'                ; IconAlignmentType
  893. ; ——————————————————————————————————————————————————————————————————————————————————————
  894. ;     • WINDOW HEADER (CDEF 21)                                                            
  895. ; ——————————————————————————————————————————————————————————————————————————————————————
  896.  
  897.                                                             ; Window Header proc IDs 
  898. kControlWindowHeaderProc        EQU        336                    ; normal header
  899. kControlWindowListViewHeaderProc EQU    337                    ; variant for list views - no bottom line
  900. ; ——————————————————————————————————————————————————————————————————————————————————————
  901. ;     • LIST BOX (CDEF 22)                                                                
  902. ; ——————————————————————————————————————————————————————————————————————————————————————
  903. ;     Lists use an auxiliary resource to define their format. The resource type used is     
  904. ;     'ldes' and a definition for it can be found in Appearance.r. The resource ID for     
  905. ;     the ldes is passed in the 'value' parameter when creating the control. You may pass 
  906. ;     zero in value. This tells the List Box control to not use a resource. The list will 
  907. ;     be created with default values, and will use the standard LDEF (0). You can change    
  908. ;     the list by getting the list handle. You can set the LDEF to use by using the tag    
  909. ;     below (kControlListBoxLDEFTag)                                                        
  910.  
  911.                                                             ; List Box proc IDs 
  912. kControlListBoxProc                EQU        352
  913. kControlListBoxAutoSizeProc        EQU        353
  914.  
  915.                                                             ; Tagged data supported by list box 
  916. kControlListBoxListHandleTag    EQU        'lhan'                ; ListHandle
  917. kControlListBoxKeyFilterTag        EQU        'fltr'                ; ControlKeyFilterUPP
  918. kControlListBoxFontStyleTag        EQU        'font'                ; ControlFontStyleRec
  919. ;  New tags in 1.0.1 or later 
  920.  
  921. kControlListBoxDoubleClickTag    EQU        'dblc'                ; Boolean. Was last click a double-click?
  922. kControlListBoxLDEFTag            EQU        'ldef'                ; SInt16. ID of LDEF to use. 
  923. ; ——————————————————————————————————————————————————————————————————————————————————————
  924. ;     • PUSH BUTTON (CDEF 23)                                                                
  925. ; ——————————————————————————————————————————————————————————————————————————————————————
  926. ;     The new standard checkbox and radio button controls support a "mixed" value that    
  927. ;     indicates that the current setting contains a mixed set of on and off values. The     
  928. ;     control value used to display this indication is defined in Controls.h:                
  929. ;                                                                                         
  930. ;         kControlCheckBoxMixedValue = 2                                                    
  931. ;                                                                                         
  932. ;     Two new variants of the standard pushbutton have been added to the standard control    
  933. ;     suite that draw a color icon next to the control title. One variant draws the icon    
  934. ;     on the left side, the other draws it on the right side (when the system justifica-    
  935. ;     tion is right to left, these are reversed).                                            
  936. ;                                                                                         
  937. ;     When either of the icon pushbuttons are created, the contrlMax field of the control 
  938. ;     record is used to determine the ID of the 'cicn' resource drawn in the pushbutton.    
  939. ;                                                                                         
  940. ;     In addition, a push button can now be told to draw with a default outline using the    
  941. ;     SetControlData routine with the kPushButtonDefaultTag below.                        
  942. ;                                                                                         
  943.  
  944.                                                             ; Theme Push Button/Check Box/Radio Button proc IDs 
  945. kControlPushButtonProc            EQU        368
  946. kControlCheckBoxProc            EQU        369
  947. kControlRadioButtonProc            EQU        370
  948. kControlPushButLeftIconProc        EQU        374                    ; Standard pushbutton with left-side icon
  949. kControlPushButRightIconProc    EQU        375                    ; Standard pushbutton with right-side icon
  950.  
  951.                                                             ; Tagged data supported by standard buttons 
  952. kControlPushButtonDefaultTag    EQU        'dflt'                ; default ring flag
  953. ; ——————————————————————————————————————————————————————————————————————————————————————
  954. ;     • SCROLL BAR (CDEF 24)                                                                
  955. ; ——————————————————————————————————————————————————————————————————————————————————————
  956. ;     This is the new Appearance scroll bar.                                                
  957. ;                                                                                         
  958.  
  959.                                                             ; Theme Scroll Bar proc IDs 
  960. kControlScrollBarProc            EQU        384                    ; normal scroll bar
  961. kControlScrollBarLiveProc        EQU        386                    ; live scrolling variant
  962. ; ——————————————————————————————————————————————————————————————————————————————————————
  963. ;     • POPUP BUTTON (CDEF 25)                                                            
  964. ; ——————————————————————————————————————————————————————————————————————————————————————
  965. ;     This is the new Appearance Popup Button. It takes the same variants and does the     
  966. ;     same overloading as the previous popup menu control. There are some differences:    
  967. ;                                                                                         
  968. ;     Passing in a menu ID of -12345 causes the popup not to try and get the menu from a    
  969. ;     resource. Instead, you can build the menu and later stuff the menuhandle field in     
  970. ;     the popup data information.                                                            
  971. ;                                                                                         
  972. ;     You can pass -1 in the Max parameter to have the control calculate the width of the    
  973. ;     title on its own instead of guessing and then tweaking to get it right. It adds the    
  974. ;     appropriate amount of space between the title and the popup.                        
  975. ;                                                                                         
  976.  
  977.                                                             ; Theme Popup Button proc IDs 
  978. kControlPopupButtonProc            EQU        400
  979. kControlPopupFixedWidthVariant    EQU        $01
  980. kControlPopupVariableWidthVariant EQU    $02
  981. kControlPopupUseAddResMenuVariant EQU    $04
  982. kControlPopupUseWFontVariant    EQU        $08                    ; kControlUsesOwningWindowsFontVariant
  983. ;  These tags are available in 1.0.1 or later of Appearance 
  984.  
  985. kControlPopupButtonMenuHandleTag EQU    'mhan'                ; MenuHandle
  986. kControlPopupButtonMenuIDTag    EQU        'mnid'                ; SInt16
  987. ; ——————————————————————————————————————————————————————————————————————————————————————
  988. ;     • RADIO GROUP (CDEF 26)                                                                
  989. ; ——————————————————————————————————————————————————————————————————————————————————————
  990. ;     This control implements a radio group. It is an embedding control and can therefore    
  991. ;      only be used when a control hierarchy is established for its owning window. You        
  992. ;     should only embed radio buttons within it. As radio buttons are embedded into it,    
  993. ;     the group sets up its value, min, and max to represent the number of embedded items.
  994. ;     The current value of the control is the index of the sub-control that is the current
  995. ;     'on' radio button. To get the current radio button control handle, you can use the    
  996. ;     control manager call GetIndSubControl, passing in the value of the radio group.        
  997. ;                                                                                         
  998. ;     NOTE: This control is only available with Appearance 1.0.1.                            
  999.  
  1000. kControlRadioGroupProc            EQU        416
  1001.  
  1002. ;   —— end of stuff only available with Appearance 1.0 and later
  1003.  
  1004.  
  1005. ; ——————————————————————————————————————————————————————————————————————————————————————
  1006. ;     • Control Variants                                                                    
  1007. ; ——————————————————————————————————————————————————————————————————————————————————————
  1008. ; typedef SInt16                         ControlVariant
  1009.  
  1010.  
  1011. kControlNoVariant                EQU        0                    ; No variant
  1012. kControlUsesOwningWindowsFontVariant EQU $08                ; Control uses owning windows font to display text
  1013. ; ——————————————————————————————————————————————————————————————————————————————————————
  1014. ;     • Control Part Codes                                                                
  1015. ; ——————————————————————————————————————————————————————————————————————————————————————
  1016.  
  1017. kControlNoPart                    EQU        0
  1018. kControlLabelPart                EQU        1
  1019. kControlMenuPart                EQU        2
  1020. kControlTrianglePart            EQU        4
  1021. kControlEditTextPart            EQU        5                    ; Appearance 1.0 and later
  1022. kControlPicturePart                EQU        6                    ; Appearance 1.0 and later
  1023. kControlIconPart                EQU        7                    ; Appearance 1.0 and later
  1024. kControlClockPart                EQU        8                    ; Appearance 1.0 and later
  1025. kControlListBoxPart                EQU        24                    ; Appearance 1.0 and later
  1026. kControlListBoxDoubleClickPart    EQU        25                    ; Appearance 1.0 and later
  1027. kControlImageWellPart            EQU        26                    ; Appearance 1.0 and later
  1028. kControlRadioGroupPart            EQU        27                    ; Appearance 1.1 and later
  1029. kControlButtonPart                EQU        10
  1030. kControlCheckBoxPart            EQU        11
  1031. kControlRadioButtonPart            EQU        11
  1032. kControlUpButtonPart            EQU        20
  1033. kControlDownButtonPart            EQU        21
  1034. kControlPageUpPart                EQU        22
  1035. kControlPageDownPart            EQU        23
  1036. kControlIndicatorPart            EQU        129
  1037. kControlDisabledPart            EQU        254
  1038. kControlInactivePart            EQU        255
  1039. ; ——————————————————————————————————————————————————————————————————————————————————————
  1040. ;     • Check Box Values                                                                    
  1041. ; ——————————————————————————————————————————————————————————————————————————————————————
  1042.  
  1043. kControlCheckBoxUncheckedValue    EQU        0
  1044. kControlCheckBoxCheckedValue    EQU        1
  1045. kControlCheckBoxMixedValue        EQU        2
  1046. ; ——————————————————————————————————————————————————————————————————————————————————————
  1047. ;     • Radio Button Values                                                                
  1048. ; ——————————————————————————————————————————————————————————————————————————————————————
  1049.  
  1050. kControlRadioButtonUncheckedValue EQU    0
  1051. kControlRadioButtonCheckedValue    EQU        1
  1052. kControlRadioButtonMixedValue    EQU        2
  1053. ; ——————————————————————————————————————————————————————————————————————————————————————
  1054. ;     • Pop-Up Menu Control Constants                                                        
  1055. ; ——————————————————————————————————————————————————————————————————————————————————————
  1056. ;  Variant codes for the System 7 pop-up menu
  1057.  
  1058. popupFixedWidth                    EQU        $01
  1059. popupVariableWidth                EQU        $02
  1060. popupUseAddResMenu                EQU        $04
  1061. popupUseWFont                    EQU        $08
  1062. ;  Menu label styles for the System 7 pop-up menu 
  1063.  
  1064. popupTitleBold                    EQU        $0100
  1065. popupTitleItalic                EQU        $0200
  1066. popupTitleUnderline                EQU        $0400
  1067. popupTitleOutline                EQU        $0800
  1068. popupTitleShadow                EQU        $1000
  1069. popupTitleCondense                EQU        $2000
  1070. popupTitleExtend                EQU        $4000
  1071. popupTitleNoStyle                EQU        $8000
  1072. ;  Menu label justifications for the System 7 pop-up menu
  1073.  
  1074. popupTitleLeftJust                EQU        $00000000
  1075. popupTitleCenterJust            EQU        $00000001
  1076. popupTitleRightJust                EQU        $000000FF
  1077. ; ——————————————————————————————————————————————————————————————————————————————————————
  1078. ;      • DragGrayRgn Constatns                                                                
  1079. ;                                                                                         
  1080. ;    For DragGrayRgnUPP used in TrackControl()                                             
  1081. ; ——————————————————————————————————————————————————————————————————————————————————————
  1082.  
  1083. noConstraint                    EQU        0
  1084. hAxisOnly                        EQU        1
  1085. vAxisOnly                        EQU        2
  1086. ; ——————————————————————————————————————————————————————————————————————————————————————
  1087. ;     • Control Creation/Deletion                                                            
  1088. ; ——————————————————————————————————————————————————————————————————————————————————————
  1089. ;
  1090. ; pascal ControlHandle NewControl(WindowPtr owningWindow, const Rect *boundsRect, ConstStr255Param controlTitle, Boolean initiallyVisible, SInt16 initialValue, SInt16 minimumValue, SInt16 maximumValue, SInt16 procID, SInt32 controlReference)
  1091. ;
  1092.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1093.         _NewControl:    OPWORD    $A954
  1094.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1095.         IMPORT_CFM_FUNCTION NewControl
  1096.     ENDIF
  1097.  
  1098. ;
  1099. ; pascal ControlHandle GetNewControl(SInt16 resourceID, WindowPtr owningWindow)
  1100. ;
  1101.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1102.         _GetNewControl:    OPWORD    $A9BE
  1103.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1104.         IMPORT_CFM_FUNCTION GetNewControl
  1105.     ENDIF
  1106.  
  1107. ;
  1108. ; pascal void DisposeControl(ControlHandle theControl)
  1109. ;
  1110.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1111.         _DisposeControl:    OPWORD    $A955
  1112.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1113.         IMPORT_CFM_FUNCTION DisposeControl
  1114.     ENDIF
  1115.  
  1116. ;
  1117. ; pascal void KillControls(WindowPtr theWindow)
  1118. ;
  1119.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1120.         _KillControls:    OPWORD    $A956
  1121.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1122.         IMPORT_CFM_FUNCTION KillControls
  1123.     ENDIF
  1124.  
  1125. ; ——————————————————————————————————————————————————————————————————————————————————————
  1126. ;     • Control Visible State                                                                
  1127. ; ——————————————————————————————————————————————————————————————————————————————————————
  1128. ;
  1129. ; pascal void HiliteControl(ControlHandle theControl, ControlPartCode hiliteState)
  1130. ;
  1131.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1132.         _HiliteControl:    OPWORD    $A95D
  1133.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1134.         IMPORT_CFM_FUNCTION HiliteControl
  1135.     ENDIF
  1136.  
  1137. ;
  1138. ; pascal void ShowControl(ControlHandle theControl)
  1139. ;
  1140.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1141.         _ShowControl:    OPWORD    $A957
  1142.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1143.         IMPORT_CFM_FUNCTION ShowControl
  1144.     ENDIF
  1145.  
  1146. ;
  1147. ; pascal void HideControl(ControlHandle theControl)
  1148. ;
  1149.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1150.         _HideControl:    OPWORD    $A958
  1151.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1152.         IMPORT_CFM_FUNCTION HideControl
  1153.     ENDIF
  1154.  
  1155.  
  1156. ;  following state routines available only with Appearance 1.0 and later
  1157. ;
  1158. ; pascal Boolean IsControlActive(ControlHandle inControl)
  1159. ;
  1160.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1161.         Macro
  1162.         _IsControlActive
  1163.             move.w              #$0005,D0
  1164.             dc.w                $AA73
  1165.         EndM
  1166.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1167.         IMPORT_CFM_FUNCTION IsControlActive
  1168.     ENDIF
  1169.  
  1170. ;
  1171. ; pascal Boolean IsControlVisible(ControlHandle inControl)
  1172. ;
  1173.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1174.         Macro
  1175.         _IsControlVisible
  1176.             move.w              #$0006,D0
  1177.             dc.w                $AA73
  1178.         EndM
  1179.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1180.         IMPORT_CFM_FUNCTION IsControlVisible
  1181.     ENDIF
  1182.  
  1183. ;
  1184. ; pascal OSErr ActivateControl(ControlHandle inControl)
  1185. ;
  1186.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1187.         Macro
  1188.         _ActivateControl
  1189.             move.w              #$0007,D0
  1190.             dc.w                $AA73
  1191.         EndM
  1192.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1193.         IMPORT_CFM_FUNCTION ActivateControl
  1194.     ENDIF
  1195.  
  1196. ;
  1197. ; pascal OSErr DeactivateControl(ControlHandle inControl)
  1198. ;
  1199.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1200.         Macro
  1201.         _DeactivateControl
  1202.             move.w              #$0008,D0
  1203.             dc.w                $AA73
  1204.         EndM
  1205.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1206.         IMPORT_CFM_FUNCTION DeactivateControl
  1207.     ENDIF
  1208.  
  1209. ;
  1210. ; pascal OSErr SetControlVisibility(ControlHandle inControl, Boolean inIsVisible, Boolean inDoDraw)
  1211. ;
  1212.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1213.         Macro
  1214.         _SetControlVisibility
  1215.             move.w              #$001E,D0
  1216.             dc.w                $AA73
  1217.         EndM
  1218.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1219.         IMPORT_CFM_FUNCTION SetControlVisibility
  1220.     ENDIF
  1221.  
  1222.  
  1223. ; ——————————————————————————————————————————————————————————————————————————————————————
  1224. ;     • Control Imaging                                                                    
  1225. ; ——————————————————————————————————————————————————————————————————————————————————————
  1226. ;
  1227. ; pascal void DrawControls(WindowPtr theWindow)
  1228. ;
  1229.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1230.         _DrawControls:    OPWORD    $A969
  1231.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1232.         IMPORT_CFM_FUNCTION DrawControls
  1233.     ENDIF
  1234.  
  1235. ;
  1236. ; pascal void Draw1Control(ControlHandle theControl)
  1237. ;
  1238.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1239.         _Draw1Control:    OPWORD    $A96D
  1240.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1241.         IMPORT_CFM_FUNCTION Draw1Control
  1242.     ENDIF
  1243.  
  1244.  
  1245. ;
  1246. ; pascal void UpdateControls(WindowPtr theWindow, RgnHandle updateRegion)
  1247. ;
  1248.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1249.         _UpdateControls:    OPWORD    $A953
  1250.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1251.         IMPORT_CFM_FUNCTION UpdateControls
  1252.     ENDIF
  1253.  
  1254.  
  1255. ;  following imaging routines available only with Appearance 1.0 and later
  1256. ;
  1257. ; pascal OSErr GetBestControlRect(ControlHandle inControl, Rect *outRect, SInt16 *outBaseLineOffset)
  1258. ;
  1259.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1260.         Macro
  1261.         _GetBestControlRect
  1262.             move.w              #$001B,D0
  1263.             dc.w                $AA73
  1264.         EndM
  1265.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1266.         IMPORT_CFM_FUNCTION GetBestControlRect
  1267.     ENDIF
  1268.  
  1269. ;
  1270. ; pascal OSErr SetControlFontStyle(ControlHandle inControl, const ControlFontStyleRec *inStyle)
  1271. ;
  1272.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1273.         Macro
  1274.         _SetControlFontStyle
  1275.             move.w              #$001C,D0
  1276.             dc.w                $AA73
  1277.         EndM
  1278.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1279.         IMPORT_CFM_FUNCTION SetControlFontStyle
  1280.     ENDIF
  1281.  
  1282. ;
  1283. ; pascal void DrawControlInCurrentPort(ControlHandle inControl)
  1284. ;
  1285.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1286.         Macro
  1287.         _DrawControlInCurrentPort
  1288.             move.w              #$0018,D0
  1289.             dc.w                $AA73
  1290.         EndM
  1291.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1292.         IMPORT_CFM_FUNCTION DrawControlInCurrentPort
  1293.     ENDIF
  1294.  
  1295. ;
  1296. ; pascal OSErr SetUpControlBackground(ControlHandle inControl, SInt16 inDepth, Boolean inIsColorDevice)
  1297. ;
  1298.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1299.         Macro
  1300.         _SetUpControlBackground
  1301.             move.w              #$001D,D0
  1302.             dc.w                $AA73
  1303.         EndM
  1304.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1305.         IMPORT_CFM_FUNCTION SetUpControlBackground
  1306.     ENDIF
  1307.  
  1308. ;  SetUpControlTextColor is available in Appearance 1.1 or later.
  1309. ;
  1310. ; pascal OSErr SetUpControlTextColor(ControlHandle inControl, SInt16 inDepth, Boolean inIsColorDevice)
  1311. ;
  1312.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1313.         IMPORT_CFM_FUNCTION SetUpControlTextColor
  1314.     ENDIF
  1315.  
  1316.  
  1317. ; ——————————————————————————————————————————————————————————————————————————————————————
  1318. ;     • Control Mousing                                                                    
  1319. ; ——————————————————————————————————————————————————————————————————————————————————————
  1320. ;    NOTE ON CONTROL ACTION PROCS
  1321. ;    
  1322. ;    When using the TrackControl() call when tracking an indicator, the actionProc parameter
  1323. ;    (type ControlActionUPP) should be replaced by a parameter of type DragGrayRgnUPP
  1324. ;    (see Quickdraw.h).
  1325. ;    
  1326. ;    If, however, you are using the live feedback variants of scroll bars or sliders, you
  1327. ;    can pass a ControlActionUPP in when tracking the indicator as well. This functionality
  1328. ;    is available in Appearance 1.0 or later.
  1329. ;
  1330.  
  1331. ;
  1332. ; pascal ControlPartCode TrackControl(ControlHandle theControl, Point startPoint, ControlActionUPP actionProc)
  1333. ;
  1334.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1335.         _TrackControl:    OPWORD    $A968
  1336.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1337.         IMPORT_CFM_FUNCTION TrackControl
  1338.     ENDIF
  1339.  
  1340. ;
  1341. ; pascal void DragControl(ControlHandle theControl, Point startPoint, const Rect *limitRect, const Rect *slopRect, DragConstraint axis)
  1342. ;
  1343.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1344.         _DragControl:    OPWORD    $A967
  1345.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1346.         IMPORT_CFM_FUNCTION DragControl
  1347.     ENDIF
  1348.  
  1349. ;
  1350. ; pascal ControlPartCode TestControl(ControlHandle theControl, Point testPoint)
  1351. ;
  1352.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1353.         _TestControl:    OPWORD    $A966
  1354.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1355.         IMPORT_CFM_FUNCTION TestControl
  1356.     ENDIF
  1357.  
  1358. ;
  1359. ; pascal ControlPartCode FindControl(Point testPoint, WindowPtr theWindow, ControlHandle *theControl)
  1360. ;
  1361.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1362.         _FindControl:    OPWORD    $A96C
  1363.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1364.         IMPORT_CFM_FUNCTION FindControl
  1365.     ENDIF
  1366.  
  1367. ;  The following mousing routines available only with Appearance 1.0 and later    
  1368. ;                                                                                 
  1369. ;  FindControlUnderMouse is preferrable to TrackControl when running under        
  1370. ;  Appearance 1.0 as you can pass in modifiers, which some of the new controls    
  1371. ;  use, such as edit text and list boxes.                                        
  1372. ;
  1373. ; pascal ControlHandle FindControlUnderMouse(Point inWhere, WindowPtr inWindow, SInt16 *outPart)
  1374. ;
  1375.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1376.         Macro
  1377.         _FindControlUnderMouse
  1378.             move.w              #$0009,D0
  1379.             dc.w                $AA73
  1380.         EndM
  1381.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1382.         IMPORT_CFM_FUNCTION FindControlUnderMouse
  1383.     ENDIF
  1384.  
  1385. ;
  1386. ; pascal SInt16 HandleControlClick(ControlHandle inControl, Point inWhere, SInt16 inModifiers, ControlActionUPP inAction)
  1387. ;
  1388.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1389.         Macro
  1390.         _HandleControlClick
  1391.             move.w              #$000A,D0
  1392.             dc.w                $AA73
  1393.         EndM
  1394.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1395.         IMPORT_CFM_FUNCTION HandleControlClick
  1396.     ENDIF
  1397.  
  1398.  
  1399.  
  1400.  
  1401. ; ——————————————————————————————————————————————————————————————————————————————————————
  1402. ;     • Control Events (available only with Appearance 1.0 and later)                        
  1403. ; ——————————————————————————————————————————————————————————————————————————————————————
  1404. ;
  1405. ; pascal SInt16 HandleControlKey(ControlHandle inControl, SInt16 inKeyCode, SInt16 inCharCode, SInt16 inModifiers)
  1406. ;
  1407.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1408.         Macro
  1409.         _HandleControlKey
  1410.             move.w              #$000B,D0
  1411.             dc.w                $AA73
  1412.         EndM
  1413.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1414.         IMPORT_CFM_FUNCTION HandleControlKey
  1415.     ENDIF
  1416.  
  1417. ;
  1418. ; pascal void IdleControls(WindowPtr inWindow)
  1419. ;
  1420.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1421.         Macro
  1422.         _IdleControls
  1423.             move.w              #$000C,D0
  1424.             dc.w                $AA73
  1425.         EndM
  1426.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1427.         IMPORT_CFM_FUNCTION IdleControls
  1428.     ENDIF
  1429.  
  1430.  
  1431.  
  1432. ; ——————————————————————————————————————————————————————————————————————————————————————
  1433. ;     • Control Positioning                                                                
  1434. ; ——————————————————————————————————————————————————————————————————————————————————————
  1435. ;
  1436. ; pascal void MoveControl(ControlHandle theControl, SInt16 h, SInt16 v)
  1437. ;
  1438.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1439.         _MoveControl:    OPWORD    $A959
  1440.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1441.         IMPORT_CFM_FUNCTION MoveControl
  1442.     ENDIF
  1443.  
  1444. ;
  1445. ; pascal void SizeControl(ControlHandle theControl, SInt16 w, SInt16 h)
  1446. ;
  1447.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1448.         _SizeControl:    OPWORD    $A95C
  1449.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1450.         IMPORT_CFM_FUNCTION SizeControl
  1451.     ENDIF
  1452.  
  1453. ; ——————————————————————————————————————————————————————————————————————————————————————
  1454. ;     • Control Title                                                                        
  1455. ; ——————————————————————————————————————————————————————————————————————————————————————
  1456. ;
  1457. ; pascal void SetControlTitle(ControlHandle theControl, ConstStr255Param title)
  1458. ;
  1459.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1460.         _SetControlTitle:    OPWORD    $A95F
  1461.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1462.         IMPORT_CFM_FUNCTION SetControlTitle
  1463.     ENDIF
  1464.  
  1465. ;
  1466. ; pascal void GetControlTitle(ControlHandle theControl, Str255 title)
  1467. ;
  1468.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1469.         _GetControlTitle:    OPWORD    $A95E
  1470.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1471.         IMPORT_CFM_FUNCTION GetControlTitle
  1472.     ENDIF
  1473.  
  1474. ; ——————————————————————————————————————————————————————————————————————————————————————
  1475. ;     • Control Value                                                                        
  1476. ; ——————————————————————————————————————————————————————————————————————————————————————
  1477. ;
  1478. ; pascal SInt16 GetControlValue(ControlHandle theControl)
  1479. ;
  1480.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1481.         _GetControlValue:    OPWORD    $A960
  1482.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1483.         IMPORT_CFM_FUNCTION GetControlValue
  1484.     ENDIF
  1485.  
  1486. ;
  1487. ; pascal void SetControlValue(ControlHandle theControl, SInt16 newValue)
  1488. ;
  1489.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1490.         _SetControlValue:    OPWORD    $A963
  1491.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1492.         IMPORT_CFM_FUNCTION SetControlValue
  1493.     ENDIF
  1494.  
  1495. ;
  1496. ; pascal SInt16 GetControlMinimum(ControlHandle theControl)
  1497. ;
  1498.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1499.         _GetControlMinimum:    OPWORD    $A961
  1500.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1501.         IMPORT_CFM_FUNCTION GetControlMinimum
  1502.     ENDIF
  1503.  
  1504. ;
  1505. ; pascal void SetControlMinimum(ControlHandle theControl, SInt16 newMinimum)
  1506. ;
  1507.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1508.         _SetControlMinimum:    OPWORD    $A964
  1509.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1510.         IMPORT_CFM_FUNCTION SetControlMinimum
  1511.     ENDIF
  1512.  
  1513. ;
  1514. ; pascal SInt16 GetControlMaximum(ControlHandle theControl)
  1515. ;
  1516.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1517.         _GetControlMaximum:    OPWORD    $A962
  1518.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1519.         IMPORT_CFM_FUNCTION GetControlMaximum
  1520.     ENDIF
  1521.  
  1522. ;
  1523. ; pascal void SetControlMaximum(ControlHandle theControl, SInt16 newMaximum)
  1524. ;
  1525.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1526.         _SetControlMaximum:    OPWORD    $A965
  1527.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1528.         IMPORT_CFM_FUNCTION SetControlMaximum
  1529.     ENDIF
  1530.  
  1531. ; ——————————————————————————————————————————————————————————————————————————————————————
  1532. ;     • Control Variant                                                                    
  1533. ; ——————————————————————————————————————————————————————————————————————————————————————
  1534. ;
  1535. ; pascal ControlVariant GetControlVariant(ControlHandle theControl)
  1536. ;
  1537.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1538.         _GetControlVariant:    OPWORD    $A809
  1539.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1540.         IMPORT_CFM_FUNCTION GetControlVariant
  1541.     ENDIF
  1542.  
  1543. ; ——————————————————————————————————————————————————————————————————————————————————————
  1544. ;     • Control Action                                                                    
  1545. ; ——————————————————————————————————————————————————————————————————————————————————————
  1546. ;
  1547. ; pascal void SetControlAction(ControlHandle theControl, ControlActionUPP actionProc)
  1548. ;
  1549.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1550.         _SetControlAction:    OPWORD    $A96B
  1551.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1552.         IMPORT_CFM_FUNCTION SetControlAction
  1553.     ENDIF
  1554.  
  1555. ;
  1556. ; pascal ControlActionUPP GetControlAction(ControlHandle theControl)
  1557. ;
  1558.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1559.         _GetControlAction:    OPWORD    $A96A
  1560.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1561.         IMPORT_CFM_FUNCTION GetControlAction
  1562.     ENDIF
  1563.  
  1564. ; ——————————————————————————————————————————————————————————————————————————————————————
  1565. ;  • Control Accessors                                                                    
  1566. ; ——————————————————————————————————————————————————————————————————————————————————————
  1567. ;
  1568. ; pascal void SetControlReference(ControlHandle theControl, SInt32 data)
  1569. ;
  1570.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1571.         _SetControlReference:    OPWORD    $A95B
  1572.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1573.         IMPORT_CFM_FUNCTION SetControlReference
  1574.     ENDIF
  1575.  
  1576. ;
  1577. ; pascal SInt32 GetControlReference(ControlHandle theControl)
  1578. ;
  1579.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1580.         _GetControlReference:    OPWORD    $A95A
  1581.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1582.         IMPORT_CFM_FUNCTION GetControlReference
  1583.     ENDIF
  1584.  
  1585. ;
  1586. ; pascal Boolean GetAuxiliaryControlRecord(ControlHandle theControl, AuxCtlHandle *acHndl)
  1587. ;
  1588.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1589.         _GetAuxiliaryControlRecord:    OPWORD    $AA44
  1590.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1591.         IMPORT_CFM_FUNCTION GetAuxiliaryControlRecord
  1592.     ENDIF
  1593.  
  1594. ;
  1595. ; pascal void SetControlColor(ControlHandle theControl, CCTabHandle newColorTable)
  1596. ;
  1597.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1598.         _SetControlColor:    OPWORD    $AA43
  1599.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1600.         IMPORT_CFM_FUNCTION SetControlColor
  1601.     ENDIF
  1602.  
  1603. ; ——————————————————————————————————————————————————————————————————————————————————————
  1604. ;     • HELPERS (available only with Appearance 1.0 and later)                            
  1605. ;                                                                                         
  1606. ;  These routines are available only thru the shared library/glue                        
  1607. ;  Bevel button routines                                                                
  1608. ; ——————————————————————————————————————————————————————————————————————————————————————
  1609.  
  1610. ;
  1611. ; pascal OSErr GetBevelButtonMenuValue(ControlHandle inButton, SInt16 *outValue)
  1612. ;
  1613.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1614.         IMPORT_CFM_FUNCTION GetBevelButtonMenuValue
  1615.     ENDIF
  1616.  
  1617. ;
  1618. ; pascal OSErr SetBevelButtonMenuValue(ControlHandle inButton, SInt16 inValue)
  1619. ;
  1620.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1621.         IMPORT_CFM_FUNCTION SetBevelButtonMenuValue
  1622.     ENDIF
  1623.  
  1624. ;
  1625. ; pascal OSErr GetBevelButtonMenuHandle(ControlHandle inButton, MenuHandle *outHandle)
  1626. ;
  1627.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1628.         IMPORT_CFM_FUNCTION GetBevelButtonMenuHandle
  1629.     ENDIF
  1630.  
  1631. ;
  1632. ; pascal OSErr GetBevelButtonContentInfo(ControlHandle inButton, ControlButtonContentInfoPtr outContent)
  1633. ;
  1634.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1635.         IMPORT_CFM_FUNCTION GetBevelButtonContentInfo
  1636.     ENDIF
  1637.  
  1638. ;
  1639. ; pascal OSErr SetBevelButtonContentInfo(ControlHandle inButton, ControlButtonContentInfoPtr inContent)
  1640. ;
  1641.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1642.         IMPORT_CFM_FUNCTION SetBevelButtonContentInfo
  1643.     ENDIF
  1644.  
  1645. ;
  1646. ; pascal OSErr SetBevelButtonTransform(ControlHandle inButton, IconTransformType transform)
  1647. ;
  1648.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1649.         IMPORT_CFM_FUNCTION SetBevelButtonTransform
  1650.     ENDIF
  1651.  
  1652. ;
  1653. ; pascal OSErr SetBevelButtonGraphicAlignment(ControlHandle inButton, ControlButtonGraphicAlignment inAlign, SInt16 inHOffset, SInt16 inVOffset)
  1654. ;
  1655.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1656.         IMPORT_CFM_FUNCTION SetBevelButtonGraphicAlignment
  1657.     ENDIF
  1658.  
  1659. ;
  1660. ; pascal OSErr SetBevelButtonTextAlignment(ControlHandle inButton, ControlButtonTextAlignment inAlign, SInt16 inHOffset)
  1661. ;
  1662.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1663.         IMPORT_CFM_FUNCTION SetBevelButtonTextAlignment
  1664.     ENDIF
  1665.  
  1666. ;
  1667. ; pascal OSErr SetBevelButtonTextPlacement(ControlHandle inButton, ControlButtonTextPlacement inWhere)
  1668. ;
  1669.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1670.         IMPORT_CFM_FUNCTION SetBevelButtonTextPlacement
  1671.     ENDIF
  1672.  
  1673. ;  Image well routines
  1674.  
  1675. ;
  1676. ; pascal OSErr GetImageWellContentInfo(ControlHandle inButton, ControlButtonContentInfoPtr outContent)
  1677. ;
  1678.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1679.         IMPORT_CFM_FUNCTION GetImageWellContentInfo
  1680.     ENDIF
  1681.  
  1682. ;
  1683. ; pascal OSErr SetImageWellContentInfo(ControlHandle inButton, ControlButtonContentInfoPtr inContent)
  1684. ;
  1685.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1686.         IMPORT_CFM_FUNCTION SetImageWellContentInfo
  1687.     ENDIF
  1688.  
  1689. ;
  1690. ; pascal OSErr SetImageWellTransform(ControlHandle inButton, IconTransformType inTransform)
  1691. ;
  1692.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1693.         IMPORT_CFM_FUNCTION SetImageWellTransform
  1694.     ENDIF
  1695.  
  1696. ;  Tab routines
  1697.  
  1698. ;
  1699. ; pascal OSErr GetTabContentRect(ControlHandle inTabControl, Rect *outContentRect)
  1700. ;
  1701.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1702.         IMPORT_CFM_FUNCTION GetTabContentRect
  1703.     ENDIF
  1704.  
  1705. ;
  1706. ; pascal OSErr SetTabEnabled(ControlHandle inTabControl, SInt16 inTabToHilite, Boolean inEnabled)
  1707. ;
  1708.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1709.         IMPORT_CFM_FUNCTION SetTabEnabled
  1710.     ENDIF
  1711.  
  1712. ;  Disclosure triangles
  1713.  
  1714. ;
  1715. ; pascal OSErr SetDisclosureTriangleLastValue(ControlHandle inTabControl, SInt16 inValue)
  1716. ;
  1717.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1718.         IMPORT_CFM_FUNCTION SetDisclosureTriangleLastValue
  1719.     ENDIF
  1720.  
  1721. ; ——————————————————————————————————————————————————————————————————————————————————————
  1722. ;     • Control Hierarchy (Appearance 1.0 and later only)                                    
  1723. ; ——————————————————————————————————————————————————————————————————————————————————————
  1724. ;
  1725. ; pascal SInt32 SendControlMessage(ControlHandle inControl, SInt16 inMessage, SInt32 inParam)
  1726. ;
  1727.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1728.         Macro
  1729.         _SendControlMessage
  1730.             move.w              #$FFFE,D0
  1731.             dc.w                $AA73
  1732.         EndM
  1733.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1734.         IMPORT_CFM_FUNCTION SendControlMessage
  1735.     ENDIF
  1736.  
  1737. ;
  1738. ; pascal OSErr DumpControlHierarchy(WindowPtr inWindow, const FSSpec *inDumpFile)
  1739. ;
  1740.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1741.         Macro
  1742.         _DumpControlHierarchy
  1743.             move.w              #$FFFF,D0
  1744.             dc.w                $AA73
  1745.         EndM
  1746.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1747.         IMPORT_CFM_FUNCTION DumpControlHierarchy
  1748.     ENDIF
  1749.  
  1750. ;
  1751. ; pascal OSErr CreateRootControl(WindowPtr inWindow, ControlHandle *outControl)
  1752. ;
  1753.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1754.         Macro
  1755.         _CreateRootControl
  1756.             move.w              #$0001,D0
  1757.             dc.w                $AA73
  1758.         EndM
  1759.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1760.         IMPORT_CFM_FUNCTION CreateRootControl
  1761.     ENDIF
  1762.  
  1763. ;
  1764. ; pascal OSErr GetRootControl(WindowPtr inWindow, ControlHandle *outControl)
  1765. ;
  1766.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1767.         Macro
  1768.         _GetRootControl
  1769.             move.w              #$0002,D0
  1770.             dc.w                $AA73
  1771.         EndM
  1772.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1773.         IMPORT_CFM_FUNCTION GetRootControl
  1774.     ENDIF
  1775.  
  1776. ;
  1777. ; pascal OSErr EmbedControl(ControlHandle inControl, ControlHandle inContainer)
  1778. ;
  1779.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1780.         Macro
  1781.         _EmbedControl
  1782.             move.w              #$0003,D0
  1783.             dc.w                $AA73
  1784.         EndM
  1785.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1786.         IMPORT_CFM_FUNCTION EmbedControl
  1787.     ENDIF
  1788.  
  1789. ;
  1790. ; pascal OSErr AutoEmbedControl(ControlHandle inControl, WindowPtr inWindow)
  1791. ;
  1792.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1793.         Macro
  1794.         _AutoEmbedControl
  1795.             move.w              #$0004,D0
  1796.             dc.w                $AA73
  1797.         EndM
  1798.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1799.         IMPORT_CFM_FUNCTION AutoEmbedControl
  1800.     ENDIF
  1801.  
  1802. ;
  1803. ; pascal OSErr GetSuperControl(ControlHandle inControl, ControlHandle *outParent)
  1804. ;
  1805.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1806.         Macro
  1807.         _GetSuperControl
  1808.             move.w              #$0015,D0
  1809.             dc.w                $AA73
  1810.         EndM
  1811.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1812.         IMPORT_CFM_FUNCTION GetSuperControl
  1813.     ENDIF
  1814.  
  1815. ;
  1816. ; pascal OSErr CountSubControls(ControlHandle inControl, SInt16 *outNumChildren)
  1817. ;
  1818.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1819.         Macro
  1820.         _CountSubControls
  1821.             move.w              #$0016,D0
  1822.             dc.w                $AA73
  1823.         EndM
  1824.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1825.         IMPORT_CFM_FUNCTION CountSubControls
  1826.     ENDIF
  1827.  
  1828. ;
  1829. ; pascal OSErr GetIndexedSubControl(ControlHandle inControl, SInt16 inIndex, ControlHandle *outSubControl)
  1830. ;
  1831.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1832.         Macro
  1833.         _GetIndexedSubControl
  1834.             move.w              #$0017,D0
  1835.             dc.w                $AA73
  1836.         EndM
  1837.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1838.         IMPORT_CFM_FUNCTION GetIndexedSubControl
  1839.     ENDIF
  1840.  
  1841. ;
  1842. ; pascal OSErr SetControlSupervisor(ControlHandle inControl, ControlHandle inBoss)
  1843. ;
  1844.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1845.         Macro
  1846.         _SetControlSupervisor
  1847.             move.w              #$001A,D0
  1848.             dc.w                $AA73
  1849.         EndM
  1850.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1851.         IMPORT_CFM_FUNCTION SetControlSupervisor
  1852.     ENDIF
  1853.  
  1854.  
  1855.  
  1856. ; ——————————————————————————————————————————————————————————————————————————————————————
  1857. ;     • Keyboard Focus (available only with Appearance 1.0 and later)                        
  1858. ; ——————————————————————————————————————————————————————————————————————————————————————
  1859. ;
  1860. ; pascal OSErr GetKeyboardFocus(WindowPtr inWindow, ControlHandle *outControl)
  1861. ;
  1862.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1863.         Macro
  1864.         _GetKeyboardFocus
  1865.             move.w              #$000D,D0
  1866.             dc.w                $AA73
  1867.         EndM
  1868.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1869.         IMPORT_CFM_FUNCTION GetKeyboardFocus
  1870.     ENDIF
  1871.  
  1872. ;
  1873. ; pascal OSErr SetKeyboardFocus(WindowPtr inWindow, ControlHandle inControl, ControlFocusPart inPart)
  1874. ;
  1875.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1876.         Macro
  1877.         _SetKeyboardFocus
  1878.             move.w              #$000E,D0
  1879.             dc.w                $AA73
  1880.         EndM
  1881.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1882.         IMPORT_CFM_FUNCTION SetKeyboardFocus
  1883.     ENDIF
  1884.  
  1885. ;
  1886. ; pascal OSErr AdvanceKeyboardFocus(WindowPtr inWindow)
  1887. ;
  1888.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1889.         Macro
  1890.         _AdvanceKeyboardFocus
  1891.             move.w              #$000F,D0
  1892.             dc.w                $AA73
  1893.         EndM
  1894.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1895.         IMPORT_CFM_FUNCTION AdvanceKeyboardFocus
  1896.     ENDIF
  1897.  
  1898. ;
  1899. ; pascal OSErr ReverseKeyboardFocus(WindowPtr inWindow)
  1900. ;
  1901.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1902.         Macro
  1903.         _ReverseKeyboardFocus
  1904.             move.w              #$0010,D0
  1905.             dc.w                $AA73
  1906.         EndM
  1907.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1908.         IMPORT_CFM_FUNCTION ReverseKeyboardFocus
  1909.     ENDIF
  1910.  
  1911. ;
  1912. ; pascal OSErr ClearKeyboardFocus(WindowPtr inWindow)
  1913. ;
  1914.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1915.         Macro
  1916.         _ClearKeyboardFocus
  1917.             move.w              #$0019,D0
  1918.             dc.w                $AA73
  1919.         EndM
  1920.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1921.         IMPORT_CFM_FUNCTION ClearKeyboardFocus
  1922.     ENDIF
  1923.  
  1924.  
  1925.  
  1926. ; ——————————————————————————————————————————————————————————————————————————————————————
  1927. ;     • Control Data (available only with Appearance 1.0 and later)                        
  1928. ; ——————————————————————————————————————————————————————————————————————————————————————
  1929.  
  1930. ;
  1931. ; pascal OSErr GetControlFeatures(ControlHandle inControl, UInt32 *outFeatures)
  1932. ;
  1933.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1934.         Macro
  1935.         _GetControlFeatures
  1936.             move.w              #$0011,D0
  1937.             dc.w                $AA73
  1938.         EndM
  1939.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1940.         IMPORT_CFM_FUNCTION GetControlFeatures
  1941.     ENDIF
  1942.  
  1943. ;
  1944. ; pascal OSErr SetControlData(ControlHandle inControl, ControlPartCode inPart, ResType inTagName, Size inSize, Ptr inData)
  1945. ;
  1946.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1947.         Macro
  1948.         _SetControlData
  1949.             move.w              #$0012,D0
  1950.             dc.w                $AA73
  1951.         EndM
  1952.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1953.         IMPORT_CFM_FUNCTION SetControlData
  1954.     ENDIF
  1955.  
  1956. ;
  1957. ; pascal OSErr GetControlData(ControlHandle inControl, ControlPartCode inPart, ResType inTagName, Size inBufferSize, Ptr inBuffer, Size *outActualSize)
  1958. ;
  1959.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1960.         Macro
  1961.         _GetControlData
  1962.             move.w              #$0013,D0
  1963.             dc.w                $AA73
  1964.         EndM
  1965.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1966.         IMPORT_CFM_FUNCTION GetControlData
  1967.     ENDIF
  1968.  
  1969. ;
  1970. ; pascal OSErr GetControlDataSize(ControlHandle inControl, ControlPartCode inPart, ResType inTagName, Size *outMaxSize)
  1971. ;
  1972.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1973.         Macro
  1974.         _GetControlDataSize
  1975.             move.w              #$0014,D0
  1976.             dc.w                $AA73
  1977.         EndM
  1978.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1979.         IMPORT_CFM_FUNCTION GetControlDataSize
  1980.     ENDIF
  1981.  
  1982.  
  1983.  
  1984.  
  1985. ; ——————————————————————————————————————————————————————————————————————————————————————
  1986. ;     • ‘CDEF’ messages                                                                    
  1987. ; ——————————————————————————————————————————————————————————————————————————————————————
  1988. ; typedef SInt16                         ControlDefProcMessage
  1989.  
  1990.  
  1991. drawCntl                        EQU        0
  1992. testCntl                        EQU        1
  1993. calcCRgns                        EQU        2
  1994. initCntl                        EQU        3
  1995. dispCntl                        EQU        4
  1996. posCntl                            EQU        5
  1997. thumbCntl                        EQU        6
  1998. dragCntl                        EQU        7
  1999. autoTrack                        EQU        8
  2000. calcCntlRgn                        EQU        10
  2001. calcThumbRgn                    EQU        11
  2002. drawThumbOutline                EQU        12
  2003. ; ——————————————————————————————————————————————————————————————————————————————————————
  2004. ;     • ‘CDEF’ entrypoint                                                                    
  2005. ; ——————————————————————————————————————————————————————————————————————————————————————
  2006. ; ——————————————————————————————————————————————————————————————————————————————————————
  2007. ;     • Constants for drawCntl message (passed in param)                                    
  2008. ; ——————————————————————————————————————————————————————————————————————————————————————
  2009.  
  2010. kDrawControlEntireControl        EQU        0
  2011. kDrawControlIndicatorOnly        EQU        129
  2012. ; ——————————————————————————————————————————————————————————————————————————————————————
  2013. ;     • Constants for dragCntl message (passed in param)                                    
  2014. ; ——————————————————————————————————————————————————————————————————————————————————————
  2015.  
  2016. kDragControlEntireControl        EQU        0
  2017. kDragControlIndicator            EQU        1
  2018. ; ——————————————————————————————————————————————————————————————————————————————————————
  2019. ;     • Drag Constraint Structure for thumbCntl message (passed in param)                    
  2020. ; ——————————————————————————————————————————————————————————————————————————————————————
  2021. IndicatorDragConstraint    RECORD 0
  2022. limitRect                 ds        Rect            ; offset: $0 (0)
  2023. slopRect                 ds        Rect            ; offset: $8 (8)
  2024. axis                     ds.w    1                ; offset: $10 (16)
  2025. sizeof                     EQU *                    ; size:   $12 (18)
  2026.                         ENDR
  2027. ; typedef struct IndicatorDragConstraint * IndicatorDragConstraintPtr
  2028.  
  2029. ; typedef IndicatorDragConstraintPtr *    IndicatorDragConstraintHandle
  2030.  
  2031.  
  2032.  
  2033.     IF ¬ TARGET_OS_MAC THEN
  2034. ; ——————————————————————————————————————————————————————————————————————————————————————
  2035. ;     • QuickTime 3.0 Win32/unix notification    mechanism                                    
  2036. ; ——————————————————————————————————————————————————————————————————————————————————————
  2037. ;  Proc used to notify window that something happened to the control
  2038.  
  2039. ;   Proc used to prefilter events before handled by control.  A client of a control calls
  2040. ;   CTRLSetPreFilterProc() to have the control call this proc before handling the event.
  2041. ;   If the proc returns TRUE, the control can go ahead and handle the event.
  2042.  
  2043.  
  2044. ;
  2045. ; extern long GetControlComponentInstance(ControlHandle theControl)
  2046. ;
  2047.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2048.         IMPORT_CFM_FUNCTION GetControlComponentInstance
  2049.     ENDIF
  2050.  
  2051. ;
  2052. ; extern ControlHandle GetControlHandleFromCookie(long cookie)
  2053. ;
  2054.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2055.         IMPORT_CFM_FUNCTION GetControlHandleFromCookie
  2056.     ENDIF
  2057.  
  2058. ;
  2059. ; extern void SetControlDefProc(short resID, ControlDefProcPtr proc)
  2060. ;
  2061.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2062.         IMPORT_CFM_FUNCTION SetControlDefProc
  2063.     ENDIF
  2064.  
  2065.     ENDIF
  2066.     IF OLDROUTINENAMES THEN
  2067. ; ——————————————————————————————————————————————————————————————————————————————————————
  2068. ;     • OLDROUTINENAMES                                                                    
  2069. ; ——————————————————————————————————————————————————————————————————————————————————————
  2070. ;  Variants applicable to all controls (at least ones with text)
  2071.  
  2072. useWFont                        EQU        $08
  2073.  
  2074. inLabel                            EQU        1
  2075. inMenu                            EQU        2
  2076. inTriangle                        EQU        4
  2077. inButton                        EQU        10
  2078. inCheckBox                        EQU        11
  2079. inUpButton                        EQU        20
  2080. inDownButton                    EQU        21
  2081. inPageUp                        EQU        22
  2082. inPageDown                        EQU        23
  2083. inThumb                            EQU        129
  2084.  
  2085. kNoHiliteControlPart            EQU        0
  2086. kInLabelControlPart                EQU        1
  2087. kInMenuControlPart                EQU        2
  2088. kInTriangleControlPart            EQU        4
  2089. kInButtonControlPart            EQU        10
  2090. kInCheckBoxControlPart            EQU        11
  2091. kInUpButtonControlPart            EQU        20
  2092. kInDownButtonControlPart        EQU        21
  2093. kInPageUpControlPart            EQU        22
  2094. kInPageDownControlPart            EQU        23
  2095. kInIndicatorControlPart            EQU        129
  2096. kReservedControlPart            EQU        254
  2097. kControlInactiveControlPart        EQU        255
  2098.     ENDIF    ; OLDROUTINENAMES
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.     ENDIF ; __CONTROLS__ 
  2105.  
  2106.